package top.magicpotato.sample;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

import java.io.IOException;
import java.net.URL;
import java.util.Objects;
import java.util.ResourceBundle;

public class Main extends Application {

    @Override
    public void start(Stage stage) throws IOException {
        URL resource = getClass().getResource("/top/magicpotato/sample/main.fxml");
        if (resource == null) {
            throw new RuntimeException("xml文件加载错误");
        }
        Pane root = FXMLLoader.load(resource, ResourceBundle.getBundle("top.magicpotato.sample.main"));
        var scene = new Scene(root);

//        stage.setResizable(false);
//        stage.setMaximized(false);
        stage.setScene(scene);
        stage.setTitle("MybatisGenerator");
        stage.getIcons().add(new Image(Objects.requireNonNull(Main.class.getResourceAsStream("/icon.png"))));
        stage.setWidth(800);
        stage.setHeight(500);
        stage.show();
    }

    public static void main(String[] args) {
        System.setProperty("prism.forceGPU","true");
        launch(args);
    }
}
